package eai.tp2.lpco.web.beans;

import java.util.List;
import java.util.Set;
import eai.tp2.lpco.database.DigitalCamera;

public class ResultsBean {

	private Result resultSet = null;
	private String query = null;
	
	public Result getResultSet() {
		return resultSet;
	}

	public void setResultSet(Result resultSet) {
		this.resultSet = resultSet;
	}

	public String getQuery() {
		return query;
	}

	public void setQuery(String query) {
		this.query = query;
	}

	public Set<String> getResults() {
		return resultSet.getNames();
	}
	
	public void setResults(List<DigitalCamera> results) {
		this.resultSet = new Result(results);
	}
	
	public DigitalCamera getResult(String name) {
		return resultSet.getDigitalCamera(name);
	}
	
	public void remove(String name) {
		resultSet.remove(name);
	}
	
	public boolean haveResults() {
		if(resultSet!=null)
			if(resultSet.getNames().size()==0)
				return false;
			else return true;
		return false;
	}	
}
